<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
</head>

<body>
  <div id="app">
    <h2>{{fullName}}</h2>
  </div>
  <script src="../js/vue.js"></script>
  <script>
    var app = new Vue({
      el: '#app',
      data: {
        name1:"kiee",
               name2:"rodrick"
      },
      computed:{
        // fullname(){
        //   return this.name1+' '+this.name2
        // }
        // 计算属性一半不使用set方法 也就是只读
        fullName:{
          set:function(text,text2){
            this.name1=text
            this.name2=text2

          },
          get:function(){
            return this.name1+' '+this.name2
          }
        }
      },
      methods: {}
    });
  </script>

</body>

</html>